﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model.SystemSetting;
using DAL.SystemSetting;

namespace BLL.SystemSetting
{
    public class LoginManagingBll
    {
        private LoginManagingDal lmDal = new LoginManagingDal();

        /// <summary>
        /// 获取用户列表
        /// </summary>
        /// <returns></returns>
        public List<UserInfo> fetchUsersList()
        {
            return lmDal.fetchUsersList();
        }

        /// <summary>
        /// 保存新用户
        /// </summary>
        /// <param name="user"></param>
        /// <returns>影响行数</returns>
        public int SaveUser(UserInfo user)
        {
            return lmDal.SaveUser(user);
        }

        /// <summary>
        /// 根据用户ID获取用户信息
        /// </summary>
        /// <param name="uid"></param>
        /// <returns></returns>
        public UserInfo FetchSingleUser(int uid)
        {
            return lmDal.FetchSingleUser(uid);
        }

        /// <summary>
        /// 更新用户信息
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        public int UpdateUser(UserInfo user)
        {
            return lmDal.UpdateUser(user);
        }

        /// <summary>
        /// 删除用户信息
        /// </summary>
        /// <param name="uid">用户编号</param>
        /// <returns></returns>
        public int DeleteSingleUser(UserInfo user)
        {
            return lmDal.DeleteSingleUser(user);
        }
    }
}
